package com.stardata.liangshisq.tcslmon.util;

import lombok.Getter;
import lombok.Setter;
import org.springframework.http.HttpStatus;

/**
 * 自定义服务端接口异常
 *
 * @author samson shu
 * @email shush@stardata.top
 * @date 2020年06月03日 15:09
 */
@Getter
@Setter
public class ApiRRException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String errmsg;
    //    private int errno = 500;
    private HttpStatus status;

    public ApiRRException(String errmsg) {
        super(errmsg);
        this.status = HttpStatus.INTERNAL_SERVER_ERROR;
        this.errmsg = errmsg;
    }

    public ApiRRException(HttpStatus status, String errmsg) {
        super(errmsg);
        this.errmsg = errmsg;
        this.status = status;
    }

    public ApiRRException(HttpStatus status, String errmsg, Throwable e) {
        super(errmsg, e);
        this.errmsg = errmsg;
        this.status = status;
    }
}
